fix: allow both _composable_pass and composable_pass imports#2965
Merged
fix: allow both _composable_pass and composable_pass imports#2965
Conversation
Contributor
Author
|
I'm on holiday tomorrow so feel free to edit/merge in my absence if need be. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2965 +/- ##
=======================================
Coverage 83.87% 83.87%
=======================================
Files 267 268 +1
Lines 52943 52945 +2
Branches 46857 46857
=======================================
+ Hits 44408 44410 +2
Misses 6266 6266
Partials 2269 2269
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CalMacCQ
commented
Mar 18, 2026
hugr-py/tests/test_passes.py
Outdated
| import pytest | ||
|
|
||
| from hugr.hugr.base import Hugr | ||
| from hugr.passes._composable_pass import * |
Contributor
Author
There was a problem hiding this comment.
Added this extra line to test that you can actually use both import paths.
maximilianruesch
requested changes
Mar 19, 2026
maximilianruesch
approved these changes
Mar 19, 2026
aborgna-q
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves breakage in #2962 by allowing both
from _composable_passandfrom composable_passimports. This is a problem as in tket-py we access the private module_composable_passfor the implementation ofPytketHugrPass(not the best practice on my part).I've added a duplicate
_composable_pass.pyfile now with a wildcard import (gross)Will remove this once we have
_composable_passusage removed from tket-py. There shouldn't be any_scopeusage in the tket-py main branch.Theres probably a nicer way to do this with something like
However this wasn't immediately working for me.
Related #2961